package com.mdinfo.gw.door.web

import com.mdinfo.base.common.bean.CommonResult
import com.mdinfo.base.common.bean.DataGrid
import com.mdinfo.gw.door.param.*
import com.mdinfo.gw.door.service.IDoorAccessService
import com.mdinfo.gw.door.vo.DoorAccessListByDeptVo
import com.mdinfo.gw.door.vo.DoorAccessListQueryVo
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController
import javax.validation.Valid

/**
 * Created by Administrator on 2018/1/9.
 */
@RestController
@RequestMapping("/sys/doorAccess")
class DoorAccessController(
        val doorAccessService:IDoorAccessService
) {

    @RequestMapping("/add")
    fun add(@Valid param: DoorAccessAddParam)
            :CommonResult<Void>{
        return doorAccessService.add(param)
    }

    @RequestMapping("/listQuery")
    fun listQuery(@Valid param: DoorAccessListQueryParam)
            :CommonResult<DataGrid<DoorAccessListQueryVo>>{
        return doorAccessService.listQuery(param)
    }

    @RequestMapping("/modify")
    fun modify(@Valid param: DoorAccessModifyParam)
            :CommonResult<Void>{
        return doorAccessService.modify(param)
    }

    @RequestMapping("/toDel")
    fun toDel(@Valid param: DoorAccessToDelParam)
            :CommonResult<Void>{
        return doorAccessService.toDel(param)
    }

    @RequestMapping("/listByDept")
    fun listByDept(@Valid param: DoorAccessListByDeptParam)
            :CommonResult<List<DoorAccessListByDeptVo>>{
        return doorAccessService.listByDept(param)
    }
}